package com.zzg.springboot.controller;

import java.util.ArrayList;
import java.util.List;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.servlet.ModelAndView;

import com.zzg.springboot.entity.ResourceEntity;

@Controller
@RequestMapping("/api/jsp")
public class JSPController {

	@RequestMapping(value = "/index", method = { RequestMethod.GET })
	public ModelAndView index() {
		List<ResourceEntity> list = new ArrayList<ResourceEntity>();
		list.add(new ResourceEntity("1", "1"));
		list.add(new ResourceEntity("2", "2"));
		list.add(new ResourceEntity("3", "3"));
		list.add(new ResourceEntity("4", "4"));
		ModelAndView modelAndView = new ModelAndView("/index");
		modelAndView.addObject("list", list);
		return modelAndView;
	}

}
